package game.web.entity;

import game.web.dao.WithdrawDAO;
import game.web.dao.dto.WithdrawDTO;
import game.web.dao.factory.WithdrawFactory;

import java.util.List;

import projectx.core.base.ProjectXSystemException;
import projectx.core.base.ProjectXUserException;

public class WithdrawEntityManager {

	public static boolean insert(WithdrawDTO dto) throws ProjectXSystemException,
			ProjectXUserException {

		WithdrawFactory factory = WithdrawFactory.getFactory();

		WithdrawDAO dao = factory.getWithdrawDAO();

		return dao.insert(dto);

	}

	public static List<WithdrawDTO> listById(String userid) throws ProjectXSystemException,
			ProjectXUserException {
		WithdrawFactory factory = WithdrawFactory.getFactory();
		WithdrawDAO dao = factory.getWithdrawDAO();
		return dao.listById(userid);
	}
	
	public static List<WithdrawDTO> listByDate(String userid,String startdate,String enddate) throws ProjectXSystemException,
			ProjectXUserException {
		WithdrawFactory factory = WithdrawFactory.getFactory();
		WithdrawDAO dao = factory.getWithdrawDAO();
		return dao.listByDate(userid,startdate,enddate);
	}
}
